//
//  TBRHomeScrollCell.m
//  TBRentClient
//
//  Created by tonbright on 2018/4/20.
//  Copyright © 2018年 tonbright. All rights reserved.
//

#import "TBRHomeScrollCell.h"
#import <SDCycleScrollView.h>
#import "BOAssistor.h"
#import "BaseWebViewController.h"
@interface TBRHomeScrollCell ()<SDCycleScrollViewDelegate>

@property (nonatomic, strong) SDCycleScrollView *cycleScrollView;


@end

@implementation TBRHomeScrollCell

- (void)awakeFromNib {
    [super awakeFromNib];
    SDCycleScrollView *cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, Width, AdaptH(130)) delegate:self placeholderImage:[UIImage imageNamed:@"home_banner_default"]];
    cycleScrollView.autoScrollTimeInterval = 5;
    self.cycleScrollView = cycleScrollView;
    [self.contentView addSubview:cycleScrollView];
}

- (void)setImageArr:(NSArray *)imageArr {
    _imageArr = imageArr;
    self.cycleScrollView.imageURLStringsGroup = imageArr;
}


#pragma mark - SDCycleScrollViewDelegate
- (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
    UINavigationController *nav = [BOAssistor getCurrentNav];
    BaseWebViewController *vc = [[BaseWebViewController alloc] initWithUrl:[NSURL URLWithString:@"http://www.baidu.com"]];
    [nav pushViewController:vc animated:YES];
}


@end
